home *** CD-ROM | disk | FTP | other *** search
- Path: newsbf02.news.aol.com!not-for-mail
- From: dogmat@aol.com (Dogmat)
- Newsgroups: comp.lang.java,comp.lang.c++,comp.lang.smalltalk
- Subject: Re: Will Java kill C++?
- Date: 17 Apr 1996 20:03:49 -0400
- Organization: America Online, Inc. (1-800-827-6364)
- Sender: root@newsbf02.news.aol.com
- Message-ID: <4l40t5$j59@newsbf02.news.aol.com>
- References: <4l3qcr$8u3@cubenx.cube.de>
- Reply-To: dogmat@aol.com (Dogmat)
- NNTP-Posting-Host: newsbf02.mail.aol.com
-
- >Forwarding is great and IMHO used way too little, maybe because many
- >people don't know something like it exists, or how easy, yet powerful
- >it is.
-
- By forwarding, I assume you mean an object implements a message by sending
- the message along to another object. If so...
-
- I fully agree with you its extremely powerful and useful, and I use it
- regularly. My big bitch about it in Smalltalk is the need to write the
- same message (message name at least) in more than one object. This makes
- it harder to maintain, because message modifications (I must be a bad
- programmer, I change method names a lot. I also add and remove them) must
- be performed in more than one location (bad OOP principle).
-
- One option is to trap the #doesNotUnderstand: method and automate the
- propogation, but this is a poor solution, really.
-
- Another option is to send messages in a generic message with an argument,
- e.g., propertyAt: or propertyAt:put:. I use this a great deal.
-
- Another option is a pattern where you define a superclass with all the
- messages defined and implemented as passing the message along. Subclasses
- then override this message and handle it explicitly. This is powerful, but
- makes things too "global". In the ridiculous limit, all methods ever
- written are also located in the Object class.
-
- None of these solutions is optimal. Still looking...
-